/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.demo11;


public class Main {
    
    private double value;
    
    
    public void ac(){
        value = 0;
    }
    
    public void add(double number){
        value += number;
    }
    
    public void substract(double number){
        value -= number;
    }
    
    public void divide(double number){
    
        try{
            value = value/number;
        }catch(Exception e){
            // TODO
        }
        
    }
    
    public void multiply(double number){
        value *= number;
    }

    public double getValue() {
        return value;
    }
    
    
    
    public static void main(String[] args){
        Main main = new Main();
        main.add(10);
        main.substract(1);
        main.multiply(2);
        main.divide(2);
        System.out.println(main.getValue());
        main.ac();
        System.out.println(main.getValue());
    }
    
}
